#ifndef __SRC_GROUP_COMMAND_H
#define __SRC_GROUP_COMMAND_H
#include <stdint.h>
typedef enum {
    GET=0,
    SET=1

}method_type_t;
typedef enum
{
    GENERAL_PURPOSE_COMMANDS, // 00-1F
    COMMANDS_FOR_CHU,         // 20-3F
    COMMANDS_FOR_CCU,         // 40-5F
    COMMANDS_FOR_CNU,         // 60-6F
    COMMANDS_FOR_MSU,         // 70-7F
    COMMANDS_FOR_VCS,         // 80-8F
    COMMANDS_FOR_RCP,         // 90-9H
    COMMANDS_FOR_IP,          // A0-AF
    COMMANDS_FOR_RM,          // B0-BF
    COMMANDS_FOR_OT,          // C0-D0
    COMMANDS_RESERVED,        // D1-EF
    COMMANDS_LOCAL,           // F0-FD
    COMMANDS_FOR_SPECIAL_APP  // FE-FF
} device_type_t;
typedef enum
{
    ACK = 0x00,
    NAK = 0x01,
    WAIT = 0x02, // reserved
    ACTIVE_SENDSING = 0x03,
    LINK = 0x06,
    MATRIX_SELECT = 0x07,
    SYSTEM_SWITCH_REL = 0x08,
    SYSTEM_SWITCH_ABS = 0x09,
    RECOVERY = 0x0A,
    SWITCH_WITH_SENDER = 0x0B,
    SYSTEM_STATUS_REQUEST_TRANSMIT = 0x0c,
    CHARACTOR_PATTERN_REQUEST_TRANSMIT = 0x0d,
    FIL_TRANSFER = 0x0F,
    INFORMATION = 0x10,
    OTHER_SYSTEM_COMMAND_DATA_TRANSFER = 0x11,
    PROTOCOL_LEVEL = 0x12,
    NOP = 0x1c,
    WHO_ARE_YOU = 0x1d,
    I_AM_HERE = 0x1e,
    ARE_YOU_THERE = 0x1f

} general_purpose_commands_t;
typedef enum
{
    CHU_SWITCH_REL = 0x20,
    CHU_SWITCH_ABS = 0x21,
    CHU_ANALOG_REL = 0x22,
    CHU_ANALOG_ABS = 0x23,
    CHU_DIAGNOSIS_INFORMATION = 0x24,
    CHU_AUTO_SETUP_CONTROL = 0x25,
    CHU_AUTO_SETUP_INFORMATION = 0x26,
    CHU_FILE_CONTROL = 0x27,
    CHU_FILE_NAME_CONTROL = 0x28,
    CHU_SWITCH_WITH_MASK = 0x29,
    CHU_ANALOG_FOR_MASTER_SLAVE = 0x2A,
    CHU_MASTER_SETUP = 0x2b,
    CHU_SEQUENCE_CONTROL = 0x2c,
    CHU_MULTI_SWITCH = 0x30,
    CHU_MULTI_ANALOG = 0x31,
    CHU_MULTI_SWITCH_STATUS = 0x32,
    CHU_MULTI_ANALOG_STATUS = 0x33,
    CHU_OP_SWITCH_REL = 0x36,
    CHU_OP_SWITCH_WITH_MASK = 0x37,
    CHU_OP_ANALOG_REL = 0x38,
    CHU_OP_ANALOG_ABS = 0x39,
    CHU_ANALOG_TRIMMING_REL = 0x3a,
    CHU_ANALOG_TRIMMING_ABS = 0x3b,
    CHU_EXT_ANALOG_REL = 0x3c,
    CHU_EXT_ANALOG_ABS = 0x3d
} command_for_chu_t;

typedef enum
{
    CCU_SWITCH_REL = 0x40,
    CCU_SWITCH_ABS = 0x41,
    CCU_ANALOG_REL = 0x42,
    CCU_ANALOG_ABS = 0x43,
    CCU_DIAGNOSIS_INFORMATION = 0x44,
    CCU_AUTO_SETUP_CONTROL = 0x45,
    CCU_AUTO_SETUP_INFORMATION = 0x46,
    CCU_FILE_CONTROL = 0x47,
    CCU_SWITCH_WITH_MASK = 0x49,

    CCU_FORMAT_CONTROL = 0x4f,
    CCU_MULTI_SWITCH = 0x50,
    CCU_MULTI_ANALOG = 0x51,
    CCU_MULTI_SWITCH_STATUS = 0x52,
    CCU_MULTI_ANALOG_STATUS=0x53,



    CCU_ANALOG_TRIMMING_REL = 0x5a,    
    CCU_ANALOG_TRIMMING_ABS = 0x5b,
    CCU_EXT_ANALOG_REL = 0x5c,
    CCU_EXT_ANALOG_ABS = 0x5d
} command_for_ccu_t;




int handle_command( uint8_t destid, uint8_t srcid, uint8_t *data, int llen);
int send_timer_command();
int report2_message();
int report1_message();
int report3_message();
int send_nak(uint8_t remoteid, uint8_t localid);
int sendack(uint8_t remoteid, uint8_t localid);
void delay_ms(int ms);
#endif //__SRC_GROUP_COMMAND_H